package com.nkdx.ws.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description:
 * @author: ZhangZeWen
 * @create: 2019-06-13 10:26
 **/
@AllArgsConstructor
@Getter
public enum CodeEnum {

    //-------------通用成功-------------
    REQUEST_SUCCESS(200, "success"),
    /**
     * 4xx 客户端错误
     * 45x 自定义错误
     * 5xx 服务器错误
     * 55x 自定义错误
     */
    //--------------通用错误-------------
    REQUEST_CLOUD_SERVER_ERROR(400,"微服务请求失败"),
    REQUEST_ILLEGAL(401, "非法访问，token校验失败"),
    COM_PARAMETE_ERROR(402, "参数错误"),
    COM_MISS_PARAM_ERROR(403, "缺少参数"),
    COM_APPID_ERROR(405, "appId error"),
    COM_ATTESTATION_ERROR(450, "签名错误"),
    WX_MSG_VALIDATE_ERROR(451, "接收微信消息时验签错误"),
    SMS_CODE_DURATION_TIME_ERROR(452, "有效期之内不重新发送"),
    COM_UNKNOW_ERROR(500, "服务器异常"),
    REQUEST_FAILURE(500, "请求失败"),
    WX_MSG_PARSE_ERROR(550, "解析微信消息失败"),
    REQUEST_EXCEPTION(551, "数据异常"),
    MICROSERVICE_REQUEST_ERROR(552,"微服务请求异常"),

    //--------------注册错误------------
    REGESTER_USER_ALREADY_EXIST(553, "邮箱已经注册,请登录邮箱点击链接进行激活"),
    REGESTER_PHONE_VERIFY_CODE_ERROR(554, "手机验证码错误"),
    ACCOUNT_GENERATION_ERRPR(555,"账号生成错误，并发导致"),
    ACCOUNT_GENERATION_FAIL(556,"账号生成失败"),
    ACCOUNT_ALREADY_EXISTS(1004,"账号已存在,请重新输入"),
    //--------------登录错误------------
    LOGIN_WX_QR_ERROR(462, "没有检测到用户扫码记录"),
    LOGIN_WX_TICKET_ERROR(561, "获取微信Ticket错误"),
    LOGIN_WX_ACCESS_TOKEN_ERROR(562, "获取微信AccessToken错误"),
    LOGIN_WX_GET_WX_INFO_ERROR(563, "从微信获取用户信息错误"),
    LOGIN_GET_NUM_FOR_USER_NAME_ONLY_LOGIN_ERROR(564, "getNumForUserNameOnlyLogin接口返回错误"),
    LOGIN_PWD_ERROR(570,"账号密码不匹配"),
    LOGIN_AUTO_SWITCH_ERROR(571,"自动登录开关关闭"),
    LOGIN_AUTO_ACCOUNT_ERROR(572,"未查询到游戏角色"),
    LOGIN_AUTO_TOKEN_ERROR(573,"未查询到有效token"),
    LOGIN_AUTO_TOKEN_TIME_OUT_ERROR(574,"登陆已过期，请重新登录"),
    LOGIN_VISITORS_XYACCOUNT_ERROR(4001,"游客账号输入错误"),
    LOGIN_VISITORS_ACCOUNT_TYPE_ERROR(4002,"账号非游客账号"),
    LOGIN_VISITORS_ACCOUNT_CREATE_LIMIT_ERROR(4023,"请勿频繁创建账号"),
    LOGIN_QQ_CHECK_ERROR(4004,"qq 校验错误"),
    LOGIN_QQ_LOGIN_USER_ERROR(4005,"qq登录 用户账号登陆异常"),
    LOGIN_QQ_QR_CODE_EXPIRED_ERROR(4006,"qq登录 二维码过期"),
    LOGIN_QQ_GET_INFO_ERROR(4007,"qq登录 获取qq信息失败"),
    LOGIN_QQ_BINDING_ERROR(4008,"绑定QQ失败"),
    LOGIN_QQ_QR_CODE_USER_NOT_AUTHORIZED_ERROR(4009,"qq登录 用户未授权"),
    LOGIN_QQ_QR_CODE_USER_LOGGED_IN_ERROR(4010,"qq登录 该二维码已完成业务,请勿重复请求"),

    //--------------信息错误------------
    COMMIT_ERROR_INFO_ALREADY_EXISTS(601, "公司信息已经存在,无法修改,如有需求,请联系我方商务人员"),
    ERROR_APP_ALREADY_EXISTS(602, "应用已经存在,无法重复创建"),
    ERROR_APP_ID_NOT_EXISTS(603, "用户ID不存在"),
    ERROR_NAME_PWD_ERROR(604, "用户名或密码错误"),


    //--------------同步账号--------------
    QRCODE_TIME_OUT(0,"二维码过期"),
    APP_QR_CODE_EFFECT(1,"二维码未被扫描"),
    APP_QR_CODE_SCAN(2,"二维码已被扫描"),
    APP_QR_APPID_ERROR(801,"appid error"),

    //--------------微信异常-------------
    WECHAT_ACCESS_TOKEN_ERROR(701,"获取微信token错误"),
    WECHAT_AOTU_RESP_ERROR(702,"微信自动回复消息异常"),
    WECHAT_PHONE_LOGIN_ERROR(703,"手机微信登陆异常"),



    //--------------游戏校验-------------
    GAME_CHECK_SUCCESS(1,"success"),
    GAME_CHECK_FAIL(2,"fail"),
    GAME_CHECK_ACCOUNT_ERROR(3,"openid invalidate"),


    //--------------账号状态-------------
    GAME_USER_TYPE_OK(1,"账号正常"),
    GAME_USER_TYPE_TITLE(0,"封号中"),


    //--------------用户画像 日志类型-----------------
    LOG_TYPE_USER_NEW(1,"用户新增日志"),
    LOG_TYPE_USER_ACTIVE(0,"用户活跃日志"),


    //-------------三方登录校验 日志类型-----------------
    VERIFY_FAIL(801,"请求三方服务器校验失败"),
    VERIFY_TIME_OUT(802,"请求三方服务器校验超时"),
    VERIFY_PARAM_ERROR(803,"从数据库找不到相应参数"),
    RESTART_NOTIFICATION(9001,"插件更新中，请稍后重启游戏"),
    ;
    private Integer code;
    private String msg;
}
